<!DOCTYPE html>
<html lang="zh_CN" class="h100">

<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE10" />
    <meta name="renderder" content="webkit" />
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport" />
    <title>安徽省社会消费品零售总额预测系统</title>
    <link rel="shortcut icon" href="../../public/images/pm.ico" />
    <link rel="bookmark" href="../../public/images/pm.ico" type="image/x-icon" 　 />
    <link rel="stylesheet" type="text/css" href="../../public/js/layui/css/layui.css" />
    <link rel="stylesheet" type="text/css" href="../../public/css/font-awesome.min.css" />
    <link rel="stylesheet" type="text/css" href="../../public/css/base.css" />
    <link rel="stylesheet" type="text/css" href="../../public/css/login.css" />
</head>

<body>
    <div class="login-main">
        <div class="login-title">
            <h1>安徽省社会消费品零售总额预测系统</h1>
        </div>
        <div class="login-box">
            <div class="login-form">
                <h2>登录</h2>
                <div>
                    <i class="username fl"></i>
                    <input type="text" name="title" placeholder="请输入用户名" autocomplete="off" class="layui-input username-input">
                </div>
                <div>
                    <i class="password fl"></i>
                    <input type="password" name="password" placeholder="请输入密码" autocomplete="off" class="layui-input password-input">
                </div>
                <a href="#" style="color: #fff;"><button class="layui-btn login-btn">登录</button></a>
            </div>
        </div>
        <div class="login-footer">
            <div class="footer-box">
                <img src="../../public/images/logo-bottom.png" alt="">
            </div>
            <div class="footer-message">
                <p>版号xxxxxx</p>
            </div>
        </div>
    </div>
    <script type="text/javascript" src="../../public/js/jquery.min.js"></script>
    <script type="text/javascript" src="../../public/js/layui/layui.js"></script>
    <script type="text/javascript">
        $(".login-btn").click(function() {
            layui.use('layer', function() {
                var layer = layui.layer;
                layer.ready(function() {
                    layer.load(1, {
                        shade: [0.6, '#000'] //0.1透明度的白色背景
                    });
                })
            });
            $.ajax({
                type: "GET",
                url: "http://ansocialsale.frpgz1.idcfengye.com/login",
                // dataType: 'jsonp', 
                contentType: "application/json",
                data: {
                    username: $(".username-input").val(),
                    password: $(".password-input").val()
                },
                dataType: "json",
                success: function(data) {
                    if (data.success) {
                        layer.closeAll();
                        location.href = '../index/index.html';
                    } else {
                        layer.closeAll();
                        layui.use('layer', function() {
                            var layer = layui.layer;
                            layer.ready(function() {
                                layer.msg('密码错误');
                            })
                        });
                    }
                }
            });
            // layui.use('layer', function () {
            //   var layer = layui.layer;
            //   layer.ready(function () {
            //     layer.load(1, {
            //       shade: [0.6,'#000'] //0.1透明度的白色背景
            //     });
            //   })
            // });
            // setTimeout(function () {
            //   layer.closeAll(); 
            //   location.href = '../index/index.html';
            // }, 1000)
        })
    </script>
</body>

</html>